cmake_minimum_required(VERSION 3.2)
project(zjson)

configure_file(
        "config.h.in"
        "config.h"
)
option(USE_TERMINAL_COLOR
        "Generate coloful output binaries" ON)

set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c11 -g")

if (USE_TERMINAL_COLOR)
    set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c11 -g -DTERMINAL_COLOR")
endif (USE_TERMINAL_COLOR)

include_directories(../../include)

aux_source_directory(. SOURCE_FILES)
add_library(zjson ${SOURCE_FILES} ../../src/z_list.c)
add_executable(minify util/minify.c)
add_executable(prettify util/prettify.c)
add_executable(jsonpath util/jsonpath.c)
add_executable(tests test/tests.c)
target_link_libraries(minify zjson)
target_link_libraries(prettify zjson)
target_link_libraries(jsonpath zjson)
target_link_libraries(tests zjson)
